using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Services;

namespace MainGame.Menu
{

  public interface IStartMenu
  {
    event MenuEvent OnPlayClicked;
    event MenuEvent OnExitClicked;
  }


  public class StartMenu : BaseMenu, IStartMenu
  {

    Button playBtn, exitBtn;

    public StartMenu(Game game, MenuDepths depth)
      : base(game, depth)
    {
      //background = game.Content.Load<Texture2D>(@"Images//Menu//startMenu");
      bounds = game.GraphicsDevice.Viewport.Bounds;
      game.Services.AddService(typeof(IStartMenu), this);
    }

    protected override void Dispose(bool disposing)
    {
      Game.Services.RemoveService(typeof(IStartMenu));
      base.Dispose(disposing);
    }


    public override void Initialize()
    {
      // Load all buttons
      //Color color = Color.Black;
      //color.A = 50;

      //Color color2 = Color.Red;
      //color2.A = 100;

      playBtn = new Button(Game, @"Images//Menu//button_play", new Rectangle(600, 400, 140, 45), "large_font", "Play");
      AddButton(playBtn, () =>
      {
        if (OnPlayClicked != null)
          OnPlayClicked();
      });

      exitBtn = new Button(Game, @"Images//Menu//button_play", new Rectangle(20, 400, 140, 45), "large_font", "Exit");
      AddButton(exitBtn, () =>
      {
        if (OnExitClicked != null)
          OnExitClicked();
      });

      base.Initialize();
    }

    public override void Update(GameTime gameTime)
    {
      // Handle animations...

      base.Update(gameTime);
    }

    public event MenuEvent OnPlayClicked;
    public event MenuEvent OnExitClicked;
 
  }
}
